package practica12;

import java.awt.*;
//import java.awt.event.*;

import javax.swing.*;

import org.antlr.runtime.tree.CommonTree;


public class MyASTFrame extends JFrame {
	
    private static final long serialVersionUID = -92059391014955313L;
	static final int WIDTH = 800;
	static final int HEIGHT = 600;

    public MyASTFrame (String lab, CommonTree t) {
            super(lab);

            JTree tree = new JTree(new ASTtoCommonTree(t));

            JScrollPane scrollPane = new JScrollPane(tree);

            JPanel panel = new JPanel();
            panel.setLayout(new BorderLayout());
            panel.add(scrollPane);

            Container content = getContentPane();
            content.add(panel, BorderLayout.CENTER);
            
            setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            setResizable(false);
            setSize(640, 480);

            setLocationRelativeTo(null);
    }


}
